home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DOSTIPS6.ZIP / DOSPART < prev    next >
Text File  |  1987-02-15  |  6KB  |  90 lines

  1.                      Hard Disk Partitioning
  2.          (PC Magazine Vol 6 No 4 Feb 24, 1987 PC Tutor)
  3.  
  4.      One advantage of the open architecture of the IBM PC is that the
  5. machine is not limited to a single operating system.  Obviously, most
  6. PCs and compatibles never run anything except Microsoft's MS-DOS.
  7. (The version of MS-DOS that IBM sells is called DOS by IBM and is
  8. often referred to as PC-DOS.  It's still MS-DOS.)  Some of the other
  9. operating systems available for the PC are Digital Research's CP/M-86
  10. and Concurrent PC-DOS, Microsoft's Xenix, and IBM's PC-IX.
  11.      When you first turn on your PC or reboot with Ctrl-Alt-Del, the
  12. ROM BIOS goes through a checkout and initialization procedure.  The
  13. BIOS then attempts to load into memory the first sector of the first
  14. surface of the first track of the floppy disk in drive A:.  The first
  15. sector on a floppy disk contains a small program (less than 512 bytes)
  16. called a "bootstrap loader."  If the floppy disk is bootable, the
  17. bootstrap loader loads the rest of the operating system into memory.
  18. The operating system is effectively pulling itself up by its own
  19. bootstraps, which is why a system reset is called a boot.
  20.      On a hard disk system, the BIOS first attempts to boot from drive
  21. A:.  If drive A: does not contain a disk or the drive door is open, the
  22. BIOS then tries to boot from the hard disk.  Again, it reads into
  23. memory the first sector of the first surface of the first cylinder of
  24. the hard disk.  If this sector contained a bootstrap loader such as the
  25. one on a diskette, the hard disk could accommodate only one operating
  26. system.
  27.      Instead, however, the first sector on a hard disk contains another
  28. small program (let's call it the "partition loader") and some partition
  29. information.  The format of this partition information is documented in
  30. IBM's DOS Technical Reference manual.  Only 16 bytes are required for
  31. each partition. These 16 bytes contain a code to identify the operating
  32. system, the starting and ending sectors of each partition on the hard
  33. disk, and which partition is bootable.
  34.      The partition loader searches through the partition information
  35. to determine which partition is marked as bootable.  Each partition
  36. contains its own bootstrap loader in the first sector of the partition.
  37. So, all the partition loader need do is load the bootstrap loader for
  38. the bootable partition and then let the bootstrap loader take over.
  39.      In summary, for a floppy disk, the BIOS loads the bootstrap
  40. loader, and the bootstrap loader loads the operating system.  For a
  41. hard disk, the BIOS loads the partition loader, the partition loader
  42. loads the bootstrap loader for the bootable partition, and the
  43. bootstrap loader loads the operating system.
  44.      The FDISK program that comes with PC-DOS allows you to divide a
  45. hard disk into one, two, three, or four partitions.  Each of these
  46. partitions can accommodate a different operating system.  Most people
  47. use the whole hard disk for DOS and thus have only one partition on
  48. the hard disk.  When you first get an XT or AT with a hard disk, you
  49. must use FDISK to define a DOS partition even before you use FORMAT.
  50.      If you use FDISK to define more than one partition on your hard
  51. disk, FDISK lets you mark one (and only one) of these partitions as
  52. "active," which means that it's bootable.  If you boot from the hard
  53. disk, the operating system in that partition will be the one that
  54. comes up.
  55.      With a partitioned hard disk you have a couple of methods by
  56. which to choose one operating system over another when you boot up
  57. your machine:
  58.           - Even if the DOS partition is not marked as bootable, you
  59. can still access it if you boot DOS from a floppy disk.  So, if you
  60. have two partitions on your hard disk -- DOS and something else -- you
  61. could use the DOS partition if you boot DOS from a floppy disk and the
  62. "something else" partition if you boot from the hard disk.  The choice
  63. would depend upon the drive A: door being open or not.
  64.           - Or, you could boot up DOS from a floppy disk, use FDISK to
  65. change the partition, then reboot from the hard disk.  This is fairly
  66. fast and if you do it a lot, you may want to set up a special disk
  67. that calls FDISK from an AUTOEXEC.BAT file.
  68.           - Microsoft's Xenix System V (which IBM licenses and sells
  69. as Xenix 2.0) has another method.  If Xenis and DOS occupy two different
  70. partitions on a hard disk and Xenix is marked as bootable, then booting
  71. from the hard disk always brings up Xenix.  But Xenix then lets you
  72. specify that you want to boot DOS instead.
  73.           - Or, the partition loader in the first sector of the hard
  74. disk could be fancied up a bit by an alternate partition loader program.
  75. This program could put a menu up on the screen that lists the different
  76. operating systems available on the hard disk and asks you for your
  77. selection.
  78.      Some words of caution:  Experimenting with hard disk partitions
  79. is best done with a clean hard disk or a hard disk with disposable
  80. data.  Changing the size of the DOS partition with FDISK wipes out the
  81. DOS partition (or at least the FAT and directory information).  FDISK
  82. will warn you about this.  Heed the warning.
  83.      If you want to take a look at the partition information, you
  84. cannot use DOS interrupt 25h, or the DEBUG L (Load) command, or any
  85. "disk look" utility that uses interrupt 25h.  This is because interrupt
  86. 25h can only get at the DOS partition.  To look at anything outside the
  87. DOS partition, you'll need to use interrupt 13h (or a "disk look"
  88. program that uses interrupt 13h).
  89.  
  90.